 <script> 


  function printSelection(node){

  var content=node.innerHTML
  var pwin=window.open('','print_content','width=700,height=800');

  pwin.document.open();
  pwin.document.write('<html><body onload="window.print()">'+content+'</body></html>');
  pwin.document.close();
 
  setTimeout(function(){pwin.close();},1000);

}

	 function savedata()
 { var proposal_name = $('#proposal_name').val();
   var user_name = $('#user_name').val();
    var user_address = $('#user_address').val();
	 var user_company = $('#user_company').val();
	  var proposal_category = $('#proposal_category').val();
	   var proposal_desc = $('#proposal_desc').val();
	    var client_name= $('#client_name').val();
		 var client_address = $('#client_address').val();
		  
 var postData = {'proposal_name':proposal_name,'user_name':user_name,'user_address':user_address,'user_company':user_company,'proposal_category':proposal_category,'proposal_desc':proposal_desc,'client_name':client_name,'client_address':client_address};
  $.ajax({type: "POST",url:'<?= site_url('user/proposal/create_proposal');?>',
  data: postData,
   success: function(data){alert("Proposal Saved as Template");   }}); }  


</script>
            <div class="row-fluid">
			
			<input type="hidden" id="proposal_name" value="<?echo $proposal_name;?>">
			<input type="hidden" id="user_name" value="<?echo $user_name;?>">
			<input type="hidden" id="user_address" value="<?echo $user_address;?>">
			<input type="hidden" id="user_company" value="<?echo $user_company;?>">
			<input type="hidden" id="proposal_category" value="<?echo $category_id;?>">
			<input type="hidden" id="proposal_desc" value="<?echo $proposal_description;?>">
			<input type="hidden" id="client_name" value="<?echo $client_name;?>">
			<input type="hidden" id="client_address" value="<?echo $client_address;?>">
			
			<span id="back" class="span2"> <a href="<?php echo site_url('user/proposal') ?>"><i class="icon-backward"> </i> Back</a>
            <a  type="button" onclick="savedata();" class="btn-danger btn-mini pointer"> Save </a></span>
			<a onclick="printSelection(document.getElementById('divToPrint'));return false"> <i class="icon-print"> </i></a><hr>
			
		    <div  class="row-fluid" id="divToPrint">
			<div id="coverpage">
			
			<div id="coverlogo"><img src="<?= $this->config->base_url(); ?>assets/images/fedlogo.png" alt="logo" width="200" height="100"/></div>
			<div id="propname"><div id="propname1"><h1><p><strong>PROPOSAL REPORT<br>ON <br></p></h2></strong> </div>
			<h2> <span id="db"><P>"<?php echo $proposal_name;?>"</P></h1> </span></div>
			<div id="by"><span id="prepby"><h3><i>Prepared For-</i></h3></span><span id="detail"><b><?php echo $client_name; echo "<br>"; echo $client_address ?></span></b>
            </div> </div>
			 
			
			
			
			<div><img src="<?= $this->config->base_url(); ?>assets/images/logo.png" alt="logo" width="300" height="120"/></div><br>
			<div id="date"> <?php echo date("F j, Y, g:i a"); ?></div>
			<div id="space"></div>
			<div id="addres">
					
					<div >
				 <span class="user"> <?php echo $user_name; echo "<br>"; echo $user_company; echo "<br>";
					  echo $user_address;?> </span>
					<div>
				   <br><span class="user">
				   <?php echo $client_name; echo "<br>";
				   echo $client_address;?> </span>
					<div></div></br>
					</div>
					</div>
				</div>
				<div id="adrs2">
				<div></div></br>
							 <div><b>
						<?echo "Dear";?> <span class="user"><?php echo $client_name;?>,</span></b>
						</br></br><span id="userdes">
							<?php echo $proposal_description;?></span></div>
						
						<div>
						</br></br>
							
							</br>

							<div id="adrs3"> Warmest Regards,<br><span class="user">
							<?php echo $user_name; echo "<br>"; echo $user_company;?></br>
							<?php echo $user_address;?></span>
							</br></br></div></div></div>
							 <div><h3><hr>
							 <?php echo "PROJECT SCOPE OF WORK & DELIVERABLES";?></h3>
							
							 <?php foreach($section_body as $row)
							 {
							
							  foreach($this->proposal_model->get_previewmodule($row->id) as $module )
							   {?><div class="heading">
							   <span id="mheading"><b>
							   <?echo $module->name;?></b></span>
								<span id="preprice"><b><?
								 echo 'Price:';?>&nbsp;
								<? echo "$";echo $module->price;?></b></span></div>
                                   <span class="pad">
								<? echo $module->description;?></span><?
								 foreach($this->proposal_model->get_previewfeatures($module->id) as $features )
								 {?><span id="fet"><STRONG><?
								   echo $features->name;?></STRONG></span>
								  <span id="des"><?echo $features->description;?></span><?
								  //echo  $features->price;
								 }
								}
								}
								?>
							 <div id="investment" class="heading">
							 <b>Project Investment</b></div>
							 <div id="totalprice" class="pad">
							   <span class="deliverable"><h4> Deliverables</h4></span>
							   <span class="time"><h4>Timeframe</h4></span> 
							    <span class="cost"><h4> Cost </h4></span>
							 <?php 
							 $totalp=0;
							 $totaldays=0;
							 foreach($section_body as $row)
							 {
							 foreach($this->proposal_model->get_previewmodule($row->id) as $module )
							   { ?>
							 <div class="pricing">
							 <span class="deliverable"><?php echo $module->name;?> </span>
							 <span class="time"><?php echo $module->days_required;?>&nbsp;<? echo "Days";?></span> 
							 <span class="cost"> <?php echo "$";echo $module->price;?></span></div>
							 <?php $totalp=$totalp+$module->price;
							   $totaldays=$totaldays+$module->days_required;
							 ?> <?php }} ?>
							 <div class="pricing">
							 <div class="deliverable"> <strong><?echo "Total";?></div>
							 <div class="time"><?echo $totaldays;?> &nbsp;<?echo "Days";?></div>
							 <div class="cost1"><?echo "$";?>&nbsp;<? echo $totalp;?></strong></div>
							 </div></div><br> <?echo "<br>";?><br>
							 
							 
						
							<?php foreach($section_footer as $footer)
				                {
				            
				         foreach($this->proposal_model->get_previewfooter($footer->id) as $footers )
				          {?>
						   <div id="footmodule">
				          <div class="heading"><b>
				           <?echo $footers->name;?></b></div>
						   <div class="description pad">
				           <?echo $footers->description;}?></div>
			                <?php } ?> <br><br><div id="foot"><strong>Fedobe Solution Pvt LTD.</strong></div></div>
							
						
			  
							 
						
							   <style>
							   #date{float:right; margin-top:4%; padding-right:7%;}
							   #addres{width:19%;
							   padding-left:2%;}
							   #adrs3{width:19%; font-size:13pz;
							   padding-left:2%;}
							   #space{width:100%;height:115px;}
							   #adrs2{padding-left:2%;font-size:13px;}
							   .heading{background-color:#EAEAEA; padding:7px; font-size:15px;}
							   #preprice{float:right; padding-right:2%;  }
							   #mheading{ padding-left:2%;}
							   .pricing{ width:100%;}
							   .deliverable{ width:60%; padding-top:2%;float:left;}
							   .time{width:20%; float:left;padding-top:2%}
							   .cost{width:20%; float:left;padding-top:2%}
							   .cost1{width:20%; padding-top:2%; float:left;}
							   #totalprice{ width:100%;}
							   #fet{font-size:13px;}
							   #foot{ padding-left:40%;}
							   #footerexpansion{padding-top:10px; float:right;}
							   .pad{padding:5px; font-size:13px; }
							   #back{float:right;}
							  #coverlogo{}
							   #address1{padding-right:35px; padding-top:65px;float:right;}
							   #propname{ height:200px; text-align:center;}
							   #proposaladdress{ height:100px;}
							    #address3{float:right;padding-left:105px; padding-top:18px;}
							   #covercontent{  margin-top:150px; padding-left:310px;color:#B21415;}
						       #coverad{float:right;padding-left:780px; color:#E27C2D;}
							   #coverpage{ height:940px; background-image:url('<?= $this->config->base_url(); ?>assets/images/backgroundbg.png'); padding:12px;}
							   #db{ color:white;}
							   #by{padding-right:13%; float:right; color:white;}
							   #des{font-size:12px;}
							   #detail{ float:right; padding-left:44%; font-size:18px; }
							   #detail1{ float:right; padding-right:121px;}
							   #prepare{float:right; }
							   #footmodule{float:left;}
							   .user{font-size:12px; }
							   #prepby{}
							   #userdes{font-size:12px; }
							   #propname1{margin-top:200px;color:white;}
							 
							   
							  
							   
							   </style>
							   </div></div></div></div>
							  